import 'package:xin_nuo_pda/bean/lot_action_entity.dart';

lotActionEntityFromJson(LotActionEntity data, Map<String, dynamic> json) {
	if (json['LOTID'] != null) {
		data.lOTID = json['LOTID'].toString();
	}
	if (json['ACTIONTYPE'] != null) {
		data.aCTIONTYPE = json['ACTIONTYPE'].toString();
	}
	if (json['ACTIONCODE'] != null) {
		data.aCTIONCODE = json['ACTIONCODE'].toString();
	}
	if (json['ACTIONCOMMENT'] != null) {
		data.aCTIONCOMMENT = json['ACTIONCOMMENT'].toString();
	}
	if (json['QTYLIST'] != null) {
		data.qTYLIST = (json['QTYLIST'] as List).map((v) => LotActionQTYLIST().fromJson(v)).toList();
	}
	return data;
}

Map<String, dynamic> lotActionEntityToJson(LotActionEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['LOTID'] = entity.lOTID;
	data['ACTIONTYPE'] = entity.aCTIONTYPE;
	data['ACTIONCODE'] = entity.aCTIONCODE;
	data['ACTIONCOMMENT'] = entity.aCTIONCOMMENT;
	data['QTYLIST'] =  entity.qTYLIST?.map((v) => v.toJson())?.toList();
	return data;
}

lotActionQTYLISTFromJson(LotActionQTYLIST data, Map<String, dynamic> json) {
	if (json['MAINQTY'] != null) {
		data.mAINQTY = json['MAINQTY'] is String
				? int.tryParse(json['MAINQTY'])
				: json['MAINQTY'].toInt();
	}
	return data;
}

Map<String, dynamic> lotActionQTYLISTToJson(LotActionQTYLIST entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['MAINQTY'] = entity.mAINQTY;
	return data;
}